package com.longer.playhelper.presenter;

import com.longer.playhelper.modle.bean.Bug;
import com.longer.playhelper.modle.biz.BugBiz;
import com.longer.playhelper.view.activity.SendBug_Activity;
import com.longer.playhelper.view.iview.ISendBug_ActivityView;

/**
 * Created by longer on 2017/7/20.
 */

public class SendBug_ActivityPresenter {
    private ISendBug_ActivityView activityView;
    private Bug.BugBiz bugBiz;

    public SendBug_ActivityPresenter(SendBug_Activity activityView) {
        this.activityView = activityView;
        bugBiz = new BugBiz();
    }
    public void save(){

        activityView.showSending();
        bugBiz.onsendbug(activityView.getContent(), activityView.getTel(), new Bug.OnSendBug() {
            @Override
            public void Success() {
                activityView.hideSending();
                activityView.sendSuccess();
                activityView.toMain_Activity();
            }

            @Override
            public void Failed(String error) {
                activityView.sendFailed(error);
                activityView.hideSending();
            }
        });
    }
}
